import os

def get_frame_folder(video_path, project_root):
    """
    根据DJI格式视频路径生成对应的帧文件夹路径.
    示例：DJI_20250110173907_0006_V.MP4 → Frames/DJI_20250110173907_0006_V
    """
    video_name = os.path.basename(video_path)
    parts = video_name.split('_')
    if len(parts) >= 4 and (parts[-1].startswith('T.') or parts[-1].startswith('V.')):
        time_stamp = parts[1]
        seq_num = parts[2]
        camera_type = parts[3].split('.')[0]
        return os.path.join(project_root, "Frames", f"DJI_{time_stamp}_{seq_num}_{camera_type}")
    else:
        return os.path.join(project_root, "Frames", os.path.splitext(video_name)[0])
